<?php
class exportAnalysis {
   var $file;
//   var $row;

   function ExcelExport() {
      $this->file = $this->__BOF();
//      $row = 0;
   }

   function __BOF() {
       return pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
   }

   function __EOF() {
       return pack("ss", 0x0A, 0x00);
   }

   function __writeString($value ) {
   //    $L = strlen($value);
       $this->file .= $value;
   }
   
  

   function download($filename) {
      header("Pragma: public");
      header("Expires: 0");
      header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
      header("Content-Type: application/force-download");
      header("Content-Type: application/octet-stream");
      header("Content-Type: application/download");;
      header("Content-Disposition: attachment;filename=$filename ");
      header("Content-Transfer-Encoding: binary ");
      $this->write();
   }
   
   function write() {
      echo $file = $this->file;//.$this->__EOF();
   }
}
